<?php
class CProductpresale extends Zend_Db_Table{
    protected $_name;
	
	protected $_primary;
	
	public function _setup(){
		
		$this->_name=R_PRE."product_presale";
		
		$this->_primary="itemid";
		
		parent::_setup();
		
	}
    public function createPresaleproduct($data){
        $itemid=$this->insert($data);
		
		return $itemid;
    }
    public function getPresaleproduct($itemid){
        $row = $this->find($itemid)->toArray();
        return $row;
    }
    public function delPresaleproduct($itemid){
        $db = $this->getAdapter();
        $where = $db->quoteInto('itemid = ?',$itemid);
        $this->delete($where);
    }
    public function updatePresaleproduct($itemid,$preprice,$allprice){
        $db = $this->getAdapter();
        $set = array('preprice'=>$preprice,'allprice'=>$allprice);
        $where = $db->quoteInto('itemid = ?',$itemid);
        $this->update($set,$where);
    }
}

     

?>